<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<title>商家发货</title>
	<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/frame/mui/js/mui.min.js"></script>
	<link href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/frame/mui/css/mui.min.css" rel="stylesheet" />
	<link rel="stylesheet" href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/frame/sui/css/SUI.css">
	<link rel="stylesheet" href="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/css/app.css?v=4">
</head>
<style type="text/css">
	p.suiTag{margin: 0}
	.suiLineInput dl input{margin: 0!important;padding:0;}
	.suiLineInput dl{height: 41px !important}
	.suiLineInput dl:nth-of-type(3){height: 81px !important}
</style>
<body class="sendgoods">
	<p class="suiTag">发货信息</p>
	<form id="form">
		<div class="suiLineInput">
			<dl>
				<dt>司机姓名</dt>
				<dd><input type="text" placeholder="请输入司机姓名" name="name"></dd>
			</dl>
			<dl>
				<dt>司机手机</dt>
				<dd><input type="text" placeholder="请输入司机手机" name="mobile"></dd>
			</dl>
			<dl class="uploadImg">
				<dt>货单图片</dt>
				<dd style="background-image: url(/static/wechat/img/add.png);">
					<input type="file" onchange='sword_uppic(this,"shop")' accept="image/*">
					<input type="hidden" name="img" value="">
				</dd>
			</dl>
		</div>
	</form>
	<button id="save">确定发货</button>
</body>
</html>
<!-- 请更新sui -->
<script type="text/javascript" src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/frame/sui/js/SUI.js?v2"></script>
<script type="text/javascript" src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/js/zepto.min.js"></script>
<script type="text/javascript" src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/wechat/js/sword_uppic.js"></script>
{{template "wechat/public/share.html" .}}
<script type="text/javascript">
	document.getElementById('save').addEventListener('tap',function(){
		var that=this
		var form=serialize('form')
		if(form.name==""){
			mui.toast("请输入司机姓名");return false;
		}
		if(form.mobile.length!=11){
			mui.toast("请输入正确的手机号码~");return false;
		}
		if(form.img==""){
			mui.toast("请上传货单图片");return false;
		}
		that.disabled=true
		mui.ajax(window.location.href,{
			type:'post',
			data:form,
			dataType:'json',
			timeout:10000,
			success: function(data){
			if (data==1) {
				mui.alert("发货成功!","",function () {
					window.location.href=document.referrer
				});
			}else{
				mui.toast("网络繁忙，请重试~");
			}
			that.disabled=false
			},
			error: function(xhr, type){
				mui.toast("网络慢，请重试");
				that.disabled=false
			// 即使加载出错，也得重置
			}
		});

	})
</script>